<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Histograms</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Histograms<div class="ingroups"><a class="el" href="../../d7/dbd/group__imgproc.html">Image Processing</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/db6/classcv_1_1CLAHE.html">cv::CLAHE</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Base class for Contrast Limited Adaptive Histogram Equalization.  <a href="../../d6/db6/classcv_1_1CLAHE.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga994f53817d621e2e4228fc646342d386"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga994f53817d621e2e4228fc646342d386">cv::HistCompMethods</a> { <br/>
  <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gga994f53817d621e2e4228fc646342d386a38c6d2cb4ae572e00aebd5642fae2add">cv::HISTCMP_CORREL</a> = 0, 
<br/>
  <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gga994f53817d621e2e4228fc646342d386aa88d6751fb2bb79e07aa8c8717fda881">cv::HISTCMP_CHISQR</a> = 1, 
<br/>
  <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gga994f53817d621e2e4228fc646342d386ae6ca1479390f52007fc572f49501c85b">cv::HISTCMP_INTERSECT</a> = 2, 
<br/>
  <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gga994f53817d621e2e4228fc646342d386ad75f6e8385d2e29479cf61ba87b57450">cv::HISTCMP_BHATTACHARYYA</a> = 3, 
<br/>
  <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gga994f53817d621e2e4228fc646342d386aab5ee4721e6f3b29ccacdeb318651f97">cv::HISTCMP_HELLINGER</a> = HISTCMP_BHATTACHARYYA, 
<br/>
  <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gga994f53817d621e2e4228fc646342d386a035d9882661edb22a95895516e441428">cv::HISTCMP_CHISQR_ALT</a> = 4, 
<br/>
  <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gga994f53817d621e2e4228fc646342d386a0ac2233c6785267fa7232a6cc2788840">cv::HISTCMP_KL_DIV</a> = 5
<br/>
 }</td></tr>
<tr class="separator:ga994f53817d621e2e4228fc646342d386"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga3a0af640716b456c3d14af8aee12e3ca"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga3a0af640716b456c3d14af8aee12e3ca">cv::calcBackProject</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *images, int nimages, const int *channels, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> hist, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> backProject, const float **ranges, double scale=1, bool uniform=true)</td></tr>
<tr class="memdesc:ga3a0af640716b456c3d14af8aee12e3ca"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the back projection of a histogram.  <a href="../../d6/dc7/group__imgproc__hist.html#ga3a0af640716b456c3d14af8aee12e3ca">More...</a><br/></td></tr>
<tr class="separator:ga3a0af640716b456c3d14af8aee12e3ca"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4a9f37b04e5c37fa3a8825774af6dfac"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga4a9f37b04e5c37fa3a8825774af6dfac">cv::calcBackProject</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *images, int nimages, const int *channels, const <a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp;hist, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> backProject, const float **ranges, double scale=1, bool uniform=true)</td></tr>
<tr class="separator:ga4a9f37b04e5c37fa3a8825774af6dfac"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab644bc90e7475cc047aa1b25dbcbd8df"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#gab644bc90e7475cc047aa1b25dbcbd8df">cv::calcBackProject</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga606feabe3b50ab6838f1ba89727aa07a">InputArrayOfArrays</a> images, const std::vector&lt; int &gt; &amp;channels, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> hist, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, const std::vector&lt; float &gt; &amp;ranges, double scale)</td></tr>
<tr class="separator:gab644bc90e7475cc047aa1b25dbcbd8df"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4b2b5fd75503ff9e6844cc4dcdaed35d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d">cv::calcHist</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *images, int nimages, const int *channels, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> mask, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> hist, int dims, const int *histSize, const float **ranges, bool uniform=true, bool <a class="el" href="../../d7/df3/group__imgproc__motion.html#ga1a567a79901513811ff3b9976923b199">accumulate</a>=false)</td></tr>
<tr class="memdesc:ga4b2b5fd75503ff9e6844cc4dcdaed35d"><td class="mdescLeft"> </td><td class="mdescRight">Calculates a histogram of a set of arrays.  <a href="../../d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d">More...</a><br/></td></tr>
<tr class="separator:ga4b2b5fd75503ff9e6844cc4dcdaed35d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gada9d547662b7f832dd7b93d378b1137d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#gada9d547662b7f832dd7b93d378b1137d">cv::calcHist</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *images, int nimages, const int *channels, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> mask, <a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp;hist, int dims, const int *histSize, const float **ranges, bool uniform=true, bool <a class="el" href="../../d7/df3/group__imgproc__motion.html#ga1a567a79901513811ff3b9976923b199">accumulate</a>=false)</td></tr>
<tr class="separator:gada9d547662b7f832dd7b93d378b1137d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga6ca1876785483836f72a77ced8ea759a"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga6ca1876785483836f72a77ced8ea759a">cv::calcHist</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga606feabe3b50ab6838f1ba89727aa07a">InputArrayOfArrays</a> images, const std::vector&lt; int &gt; &amp;channels, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> mask, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> hist, const std::vector&lt; int &gt; &amp;histSize, const std::vector&lt; float &gt; &amp;ranges, bool <a class="el" href="../../d7/df3/group__imgproc__motion.html#ga1a567a79901513811ff3b9976923b199">accumulate</a>=false)</td></tr>
<tr class="separator:ga6ca1876785483836f72a77ced8ea759a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf4190090efa5c47cb367cf97a9a519bd"><td align="right" class="memItemLeft" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#gaf4190090efa5c47cb367cf97a9a519bd">cv::compareHist</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> H1, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> H2, int method)</td></tr>
<tr class="memdesc:gaf4190090efa5c47cb367cf97a9a519bd"><td class="mdescLeft"> </td><td class="mdescRight">Compares two histograms.  <a href="../../d6/dc7/group__imgproc__hist.html#gaf4190090efa5c47cb367cf97a9a519bd">More...</a><br/></td></tr>
<tr class="separator:gaf4190090efa5c47cb367cf97a9a519bd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga41a249ba9a536bf2b47e95f8c7dd42b0"><td align="right" class="memItemLeft" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga41a249ba9a536bf2b47e95f8c7dd42b0">cv::compareHist</a> (const <a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp;H1, const <a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp;H2, int method)</td></tr>
<tr class="separator:ga41a249ba9a536bf2b47e95f8c7dd42b0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad689d2607b7b3889453804f414ab1018"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../d6/db6/classcv_1_1CLAHE.html">CLAHE</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#gad689d2607b7b3889453804f414ab1018">cv::createCLAHE</a> (double clipLimit=40.0, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> tileGridSize=<a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>(8, 8))</td></tr>
<tr class="memdesc:gad689d2607b7b3889453804f414ab1018"><td class="mdescLeft"> </td><td class="mdescRight">Creates a smart pointer to a <a class="el" href="../../d6/db6/classcv_1_1CLAHE.html" title="Base class for Contrast Limited Adaptive Histogram Equalization. ">cv::CLAHE</a> class and initializes it.  <a href="../../d6/dc7/group__imgproc__hist.html#gad689d2607b7b3889453804f414ab1018">More...</a><br/></td></tr>
<tr class="separator:gad689d2607b7b3889453804f414ab1018"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga902b8e60cc7075c8947345489221e0e0"><td align="right" class="memItemLeft" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga902b8e60cc7075c8947345489221e0e0">cv::EMD</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> signature1, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> signature2, int distType, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> cost=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), float *lowerBound=0, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> flow=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>())</td></tr>
<tr class="memdesc:ga902b8e60cc7075c8947345489221e0e0"><td class="mdescLeft"> </td><td class="mdescRight">Computes the "minimal work" distance between two weighted point configurations.  <a href="../../d6/dc7/group__imgproc__hist.html#ga902b8e60cc7075c8947345489221e0e0">More...</a><br/></td></tr>
<tr class="separator:ga902b8e60cc7075c8947345489221e0e0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7e54091f0c937d49bf84152a16f76d6e"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga7e54091f0c937d49bf84152a16f76d6e">cv::equalizeHist</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst)</td></tr>
<tr class="memdesc:ga7e54091f0c937d49bf84152a16f76d6e"><td class="mdescLeft"> </td><td class="mdescRight">Equalizes the histogram of a grayscale image.  <a href="../../d6/dc7/group__imgproc__hist.html#ga7e54091f0c937d49bf84152a16f76d6e">More...</a><br/></td></tr>
<tr class="separator:ga7e54091f0c937d49bf84152a16f76d6e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga31fdda0864e64ca6b9de252a2611758b"><td align="right" class="memItemLeft" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga31fdda0864e64ca6b9de252a2611758b">cv::wrapperEMD</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> signature1, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> signature2, int distType, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> cost=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; float &gt; lowerBound=<a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; float &gt;(), <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> flow=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>())</td></tr>
<tr class="separator:ga31fdda0864e64ca6b9de252a2611758b"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga994f53817d621e2e4228fc646342d386"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga994f53817d621e2e4228fc646342d386">◆ </a></span>HistCompMethods</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga994f53817d621e2e4228fc646342d386">cv::HistCompMethods</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Histogram comparison methods </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga994f53817d621e2e4228fc646342d386a38c6d2cb4ae572e00aebd5642fae2add"></a>HISTCMP_CORREL <div class="python_language">Python: cv.HISTCMP_CORREL</div></td><td class="fielddoc"><p>Correlation </p><p class="formulaDsp">
\[d(H_1,H_2) = \frac{\sum_I (H_1(I) - \bar{H_1}) (H_2(I) - \bar{H_2})}{\sqrt{\sum_I(H_1(I) - \bar{H_1})^2 \sum_I(H_2(I) - \bar{H_2})^2}}\]
</p>
<p> where </p><p class="formulaDsp">
\[\bar{H_k} = \frac{1}{N} \sum _J H_k(J)\]
</p>
<p> and \(N\) is a total number of histogram bins. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga994f53817d621e2e4228fc646342d386aa88d6751fb2bb79e07aa8c8717fda881"></a>HISTCMP_CHISQR <div class="python_language">Python: cv.HISTCMP_CHISQR</div></td><td class="fielddoc"><p>Chi-Square </p><p class="formulaDsp">
\[d(H_1,H_2) = \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga994f53817d621e2e4228fc646342d386ae6ca1479390f52007fc572f49501c85b"></a>HISTCMP_INTERSECT <div class="python_language">Python: cv.HISTCMP_INTERSECT</div></td><td class="fielddoc"><p>Intersection </p><p class="formulaDsp">
\[d(H_1,H_2) = \sum _I \min (H_1(I), H_2(I))\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga994f53817d621e2e4228fc646342d386ad75f6e8385d2e29479cf61ba87b57450"></a>HISTCMP_BHATTACHARYYA <div class="python_language">Python: cv.HISTCMP_BHATTACHARYYA</div></td><td class="fielddoc"><p>Bhattacharyya distance (In fact, OpenCV computes Hellinger distance, which is related to Bhattacharyya coefficient.) </p><p class="formulaDsp">
\[d(H_1,H_2) = \sqrt{1 - \frac{1}{\sqrt{\bar{H_1} \bar{H_2} N^2}} \sum_I \sqrt{H_1(I) \cdot H_2(I)}}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga994f53817d621e2e4228fc646342d386aab5ee4721e6f3b29ccacdeb318651f97"></a>HISTCMP_HELLINGER <div class="python_language">Python: cv.HISTCMP_HELLINGER</div></td><td class="fielddoc"><p>Synonym for HISTCMP_BHATTACHARYYA. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga994f53817d621e2e4228fc646342d386a035d9882661edb22a95895516e441428"></a>HISTCMP_CHISQR_ALT <div class="python_language">Python: cv.HISTCMP_CHISQR_ALT</div></td><td class="fielddoc"><p>Alternative Chi-Square </p><p class="formulaDsp">
\[d(H_1,H_2) = 2 * \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)+H_2(I)}\]
</p>
<p> This alternative formula is regularly used for texture comparison. See e.g. <a class="el" href="../../d0/de3/citelist.html#CITEREF_Puzicha1997">[199]</a> </p>
</td></tr>
<tr><td class="fieldname"><a id="gga994f53817d621e2e4228fc646342d386a0ac2233c6785267fa7232a6cc2788840"></a>HISTCMP_KL_DIV <div class="python_language">Python: cv.HISTCMP_KL_DIV</div></td><td class="fielddoc"><p>Kullback-Leibler divergence </p><p class="formulaDsp">
\[d(H_1,H_2) = \sum _I H_1(I) \log \left(\frac{H_1(I)}{H_2(I)}\right)\]
</p>
 </td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga3a0af640716b456c3d14af8aee12e3ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3a0af640716b456c3d14af8aee12e3ca">◆ </a></span>calcBackProject() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::calcBackProject </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> * </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>nimages</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int * </td>
          <td class="paramname"><em>channels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>hist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>backProject</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float ** </td>
          <td class="paramname"><em>ranges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>scale</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>uniform</em> = <code>true</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.calcBackProject(</td><td class="paramname">images, channels, hist, ranges, scale[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the back projection of a histogram. </p>
<p>The function <a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga3a0af640716b456c3d14af8aee12e3ca" title="Calculates the back projection of a histogram. ">cv::calcBackProject</a> calculates the back project of the histogram. That is, similarly to <a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d" title="Calculates a histogram of a set of arrays. ">calcHist</a> , at each location (x, y) the function collects the values from the selected channels in the input images and finds the corresponding histogram bin. But instead of incrementing it, the function reads the bin value, scales it by scale , and stores in backProject(x,y) . In terms of statistics, the function computes probability of each element value in respect with the empirical probability distribution represented by the histogram. See how, for example, you can find and track a bright-colored object in a scene:</p>
<ul>
<li>Before tracking, show the object to the camera so that it covers almost the whole frame. Calculate a hue histogram. The histogram may have strong maximums, corresponding to the dominant colors in the object.</li>
<li>When tracking, calculate a back projection of a hue plane of each input video frame using that pre-computed histogram. Threshold the back projection to suppress weak colors. It may also make sense to suppress pixels with non-sufficient color saturation and too dark or too bright pixels.</li>
<li>Find connected components in the resulting picture and choose, for example, the largest component.</li>
</ul>
<p>This is an approximate algorithm of the CamShift color object tracker.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">images</td><td>Source arrays. They all should have the same depth, CV_8U, CV_16U or CV_32F , and the same size. Each of them can have an arbitrary number of channels. </td></tr>
    <tr><td class="paramname">nimages</td><td>Number of source images. </td></tr>
    <tr><td class="paramname">channels</td><td>The list of channels used to compute the back projection. The number of channels must match the histogram dimensionality. The first array channels are numerated from 0 to images[0].channels()-1 , the second array channels are counted from images[0].channels() to images[0].channels() + images[1].channels()-1, and so on. </td></tr>
    <tr><td class="paramname">hist</td><td>Input histogram that can be dense or sparse. </td></tr>
    <tr><td class="paramname">backProject</td><td>Destination back projection array that is a single-channel array of the same size and depth as images[0] . </td></tr>
    <tr><td class="paramname">ranges</td><td>Array of arrays of the histogram bin boundaries in each dimension. See <a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d" title="Calculates a histogram of a set of arrays. ">calcHist</a> . </td></tr>
    <tr><td class="paramname">scale</td><td>Optional scale factor for the output back projection. </td></tr>
    <tr><td class="paramname">uniform</td><td>Flag indicating whether the histogram is uniform or not (see above).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d" title="Calculates a histogram of a set of arrays. ">calcHist</a>, <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gaf4190090efa5c47cb367cf97a9a519bd" title="Compares two histograms. ">compareHist</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/d7f/samples_2cpp_2camshiftdemo_8cpp-example.html#a52">samples/cpp/camshiftdemo.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga4a9f37b04e5c37fa3a8825774af6dfac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4a9f37b04e5c37fa3a8825774af6dfac">◆ </a></span>calcBackProject() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::calcBackProject </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> * </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>nimages</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int * </td>
          <td class="paramname"><em>channels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp; </td>
          <td class="paramname"><em>hist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>backProject</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float ** </td>
          <td class="paramname"><em>ranges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>scale</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>uniform</em> = <code>true</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.calcBackProject(</td><td class="paramname">images, channels, hist, ranges, scale[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="gab644bc90e7475cc047aa1b25dbcbd8df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab644bc90e7475cc047aa1b25dbcbd8df">◆ </a></span>calcBackProject() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::calcBackProject </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga606feabe3b50ab6838f1ba89727aa07a">InputArrayOfArrays</a> </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp; </td>
          <td class="paramname"><em>channels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>hist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; float &gt; &amp; </td>
          <td class="paramname"><em>ranges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>scale</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.calcBackProject(</td><td class="paramname">images, channels, hist, ranges, scale[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="ga4b2b5fd75503ff9e6844cc4dcdaed35d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4b2b5fd75503ff9e6844cc4dcdaed35d">◆ </a></span>calcHist() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::calcHist </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> * </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>nimages</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int * </td>
          <td class="paramname"><em>channels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>hist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dims</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int * </td>
          <td class="paramname"><em>histSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float ** </td>
          <td class="paramname"><em>ranges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>uniform</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>accumulate</em> = <code>false</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>hist</td><td>=</td><td>cv.calcHist(</td><td class="paramname">images, channels, mask, histSize, ranges[, hist[, accumulate]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates a histogram of a set of arrays. </p>
<p>The function <a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d" title="Calculates a histogram of a set of arrays. ">cv::calcHist</a> calculates the histogram of one or more arrays. The elements of a tuple used to increment a histogram bin are taken from the corresponding input arrays at the same location. The sample below shows how to compute a 2D Hue-Saturation histogram for a color image. : </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d4/dd5/highgui_8hpp.html">opencv2/highgui.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main( <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv )</div><div class="line">{</div><div class="line">    <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> src, hsv;</div><div class="line">    <span class="keywordflow">if</span>( argc != 2 || !(src=<a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>(argv[1], 1)).data )</div><div class="line">        <span class="keywordflow">return</span> -1;</div><div class="line"></div><div class="line">    <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#ga397ae87e1288a81d2363b61574eb8cab">cvtColor</a>(src, hsv, <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#gga4e0972be5de079fed4e3a10e24ef5ef0aa4a7f0ecf2e94150699e48c79139ee12">COLOR_BGR2HSV</a>);</div><div class="line"></div><div class="line">    <span class="comment">// Quantize the hue to 30 levels</span></div><div class="line">    <span class="comment">// and the saturation to 32 levels</span></div><div class="line">    <span class="keywordtype">int</span> hbins = 30, sbins = 32;</div><div class="line">    <span class="keywordtype">int</span> histSize[] = {hbins, sbins};</div><div class="line">    <span class="comment">// hue varies from 0 to 179, see cvtColor</span></div><div class="line">    <span class="keywordtype">float</span> hranges[] = { 0, 180 };</div><div class="line">    <span class="comment">// saturation varies from 0 (black-gray-white) to</span></div><div class="line">    <span class="comment">// 255 (pure spectrum color)</span></div><div class="line">    <span class="keywordtype">float</span> sranges[] = { 0, 256 };</div><div class="line">    <span class="keyword">const</span> <span class="keywordtype">float</span>* ranges[] = { hranges, sranges };</div><div class="line">    MatND hist;</div><div class="line">    <span class="comment">// we compute the histogram from the 0-th and 1-st channels</span></div><div class="line">    <span class="keywordtype">int</span> channels[] = {0, 1};</div><div class="line"></div><div class="line">    <a class="code" href="../../d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d">calcHist</a>( &amp;hsv, 1, channels, <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a>(), <span class="comment">// do not use mask</span></div><div class="line">             hist, 2, histSize, ranges,</div><div class="line">             <span class="keyword">true</span>, <span class="comment">// the histogram is uniform</span></div><div class="line">             <span class="keyword">false</span> );</div><div class="line">    <span class="keywordtype">double</span> maxVal=0;</div><div class="line">    <a class="code" href="../../d2/de8/group__core__array.html#gab473bf2eb6d14ff97e89b355dac20707">minMaxLoc</a>(hist, 0, &amp;maxVal, 0, 0);</div><div class="line"></div><div class="line">    <span class="keywordtype">int</span> <a class="code" href="../../d6/d84/namespacecv_1_1quality_1_1quality__utils.html#ae55d1c89ff5761730174745401162743">scale</a> = 10;</div><div class="line">    <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> histImg = <a class="code" href="../../d3/d63/classcv_1_1Mat.html#a0b57b6a326c8876d944d188a46e0f556">Mat::zeros</a>(sbins*scale, hbins*10, <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga88c4cd9de76f678f33928ef1e3f96047">CV_8UC3</a>);</div><div class="line"></div><div class="line">    <span class="keywordflow">for</span>( <span class="keywordtype">int</span> h = 0; h &lt; hbins; h++ )</div><div class="line">        <span class="keywordflow">for</span>( <span class="keywordtype">int</span> s = 0; s &lt; sbins; s++ )</div><div class="line">        {</div><div class="line">            <span class="keywordtype">float</span> binVal = hist.at&lt;<span class="keywordtype">float</span>&gt;(h, s);</div><div class="line">            <span class="keywordtype">int</span> intensity = <a class="code" href="../../db/de0/group__core__utils.html#ga085eca238176984a0b72df2818598d85">cvRound</a>(binVal*255/maxVal);</div><div class="line">            <a class="code" href="../../d6/d6e/group__imgproc__draw.html#ga07d2f74cadcf8e305e810ce8eed13bc9">rectangle</a>( histImg, <a class="code" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(h*scale, s*scale),</div><div class="line">                        <a class="code" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>( (h+1)*scale - 1, (s+1)*scale - 1),</div><div class="line">                        <a class="code" href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f">Scalar::all</a>(intensity),</div><div class="line">                        -1 );</div><div class="line">        }</div><div class="line"></div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b">namedWindow</a>( <span class="stringliteral">"Source"</span>, 1 );</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">"Source"</span>, src );</div><div class="line"></div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b">namedWindow</a>( <span class="stringliteral">"H-S Histogram"</span>, 1 );</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">"H-S Histogram"</span>, histImg );</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">waitKey</a>();</div><div class="line">}</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">images</td><td>Source arrays. They all should have the same depth, CV_8U, CV_16U or CV_32F , and the same size. Each of them can have an arbitrary number of channels. </td></tr>
    <tr><td class="paramname">nimages</td><td>Number of source images. </td></tr>
    <tr><td class="paramname">channels</td><td>List of the dims channels used to compute the histogram. The first array channels are numerated from 0 to images[0].channels()-1 , the second array channels are counted from images[0].channels() to images[0].channels() + images[1].channels()-1, and so on. </td></tr>
    <tr><td class="paramname">mask</td><td>Optional mask. If the matrix is not empty, it must be an 8-bit array of the same size as images[i] . The non-zero mask elements mark the array elements counted in the histogram. </td></tr>
    <tr><td class="paramname">hist</td><td>Output histogram, which is a dense or sparse dims -dimensional array. </td></tr>
    <tr><td class="paramname">dims</td><td>Histogram dimensionality that must be positive and not greater than CV_MAX_DIMS (equal to 32 in the current OpenCV version). </td></tr>
    <tr><td class="paramname">histSize</td><td>Array of histogram sizes in each dimension. </td></tr>
    <tr><td class="paramname">ranges</td><td>Array of the dims arrays of the histogram bin boundaries in each dimension. When the histogram is uniform ( uniform =true), then for each dimension i it is enough to specify the lower (inclusive) boundary \(L_0\) of the 0-th histogram bin and the upper (exclusive) boundary \(U_{\texttt{histSize}[i]-1}\) for the last histogram bin histSize[i]-1 . That is, in case of a uniform histogram each of ranges[i] is an array of 2 elements. When the histogram is not uniform ( uniform=false ), then each of ranges[i] contains histSize[i]+1 elements: \(L_0, U_0=L_1, U_1=L_2, ..., U_{\texttt{histSize[i]}-2}=L_{\texttt{histSize[i]}-1}, U_{\texttt{histSize[i]}-1}\) . The array elements, that are not between \(L_0\) and \(U_{\texttt{histSize[i]}-1}\) , are not counted in the histogram. </td></tr>
    <tr><td class="paramname">uniform</td><td>Flag indicating whether the histogram is uniform or not (see above). </td></tr>
    <tr><td class="paramname">accumulate</td><td>Accumulation flag. If it is set, the histogram is not cleared in the beginning when it is allocated. This feature enables you to compute a single histogram from several sets of arrays, or to update the histogram in time. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/d7f/samples_2cpp_2camshiftdemo_8cpp-example.html#a40">samples/cpp/camshiftdemo.cpp</a>, and <a class="el" href="../../da/d53/samples_2cpp_2demhist_8cpp-example.html#a4">samples/cpp/demhist.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="gada9d547662b7f832dd7b93d378b1137d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gada9d547662b7f832dd7b93d378b1137d">◆ </a></span>calcHist() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::calcHist </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> * </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>nimages</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int * </td>
          <td class="paramname"><em>channels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp; </td>
          <td class="paramname"><em>hist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dims</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int * </td>
          <td class="paramname"><em>histSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float ** </td>
          <td class="paramname"><em>ranges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>uniform</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>accumulate</em> = <code>false</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>hist</td><td>=</td><td>cv.calcHist(</td><td class="paramname">images, channels, mask, histSize, ranges[, hist[, accumulate]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.</p>
<p>this variant uses SparseMat for output </p>
</div>
</div>
<a id="ga6ca1876785483836f72a77ced8ea759a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6ca1876785483836f72a77ced8ea759a">◆ </a></span>calcHist() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::calcHist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga606feabe3b50ab6838f1ba89727aa07a">InputArrayOfArrays</a> </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp; </td>
          <td class="paramname"><em>channels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>hist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp; </td>
          <td class="paramname"><em>histSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; float &gt; &amp; </td>
          <td class="paramname"><em>ranges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>accumulate</em> = <code>false</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>hist</td><td>=</td><td>cv.calcHist(</td><td class="paramname">images, channels, mask, histSize, ranges[, hist[, accumulate]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="gaf4190090efa5c47cb367cf97a9a519bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf4190090efa5c47cb367cf97a9a519bd">◆ </a></span>compareHist() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double cv::compareHist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>H1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>H2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>method</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.compareHist(</td><td class="paramname">H1, H2, method</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Compares two histograms. </p>
<p>The function <a class="el" href="../../d6/dc7/group__imgproc__hist.html#gaf4190090efa5c47cb367cf97a9a519bd" title="Compares two histograms. ">cv::compareHist</a> compares two dense or two sparse histograms using the specified method.</p>
<p>The function returns \(d(H_1, H_2)\) .</p>
<p>While the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable for high-dimensional sparse histograms. In such histograms, because of aliasing and sampling problems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms or more general sparse configurations of weighted points, consider using the <a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga902b8e60cc7075c8947345489221e0e0" title='Computes the "minimal work" distance between two weighted point configurations. '>EMD</a> function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">H1</td><td>First compared histogram. </td></tr>
    <tr><td class="paramname">H2</td><td>Second compared histogram of the same size as H1 . </td></tr>
    <tr><td class="paramname">method</td><td>Comparison method, see <a class="el" href="../../d6/dc7/group__imgproc__hist.html#ga994f53817d621e2e4228fc646342d386">HistCompMethods</a> </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga41a249ba9a536bf2b47e95f8c7dd42b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga41a249ba9a536bf2b47e95f8c7dd42b0">◆ </a></span>compareHist() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double cv::compareHist </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp; </td>
          <td class="paramname"><em>H1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dd/da9/classcv_1_1SparseMat.html">SparseMat</a> &amp; </td>
          <td class="paramname"><em>H2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>method</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.compareHist(</td><td class="paramname">H1, H2, method</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="gad689d2607b7b3889453804f414ab1018"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad689d2607b7b3889453804f414ab1018">◆ </a></span>createCLAHE()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../d6/db6/classcv_1_1CLAHE.html">CLAHE</a>&gt; cv::createCLAHE </td>
          <td>(</td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>clipLimit</em> = <code>40.0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>tileGridSize</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>(8, 8)</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.createCLAHE(</td><td class="paramname">[, clipLimit[, tileGridSize]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Creates a smart pointer to a <a class="el" href="../../d6/db6/classcv_1_1CLAHE.html" title="Base class for Contrast Limited Adaptive Histogram Equalization. ">cv::CLAHE</a> class and initializes it. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">clipLimit</td><td>Threshold for contrast limiting. </td></tr>
    <tr><td class="paramname">tileGridSize</td><td>Size of grid for histogram equalization. Input image will be divided into equally sized rectangular tiles. tileGridSize defines the number of tiles in row and column. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga902b8e60cc7075c8947345489221e0e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga902b8e60cc7075c8947345489221e0e0">◆ </a></span>EMD()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float cv::EMD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>signature1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>signature2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>distType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>cost</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float * </td>
          <td class="paramname"><em>lowerBound</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>flow</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Computes the "minimal work" distance between two weighted point configurations. </p>
<p>The function computes the earth mover distance and/or a lower boundary of the distance between the two weighted point configurations. One of the applications described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_RubnerSept98">[208]</a>, <a class="el" href="../../d0/de3/citelist.html#CITEREF_Rubner2000">[209]</a> is multi-dimensional histogram comparison for image retrieval. EMD is a transportation problem that is solved using some modification of a simplex algorithm, thus the complexity is exponential in the worst case, though, on average it is much faster. In the case of a real metric the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used to determine roughly whether the two signatures are far enough so that they cannot relate to the same object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">signature1</td><td>First signature, a \(\texttt{size1}\times \texttt{dims}+1\) floating-point matrix. Each row stores the point weight followed by the point coordinates. The matrix is allowed to have a single column (weights only) if the user-defined cost matrix is used. The weights must be non-negative and have at least one non-zero value. </td></tr>
    <tr><td class="paramname">signature2</td><td>Second signature of the same format as signature1 , though the number of rows may be different. The total weights may be different. In this case an extra "dummy" point is added to either signature1 or signature2. The weights must be non-negative and have at least one non-zero value. </td></tr>
    <tr><td class="paramname">distType</td><td>Used metric. See <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa2bfbebbc5c320526897996aafa1d8eb">DistanceTypes</a>. </td></tr>
    <tr><td class="paramname">cost</td><td>User-defined \(\texttt{size1}\times \texttt{size2}\) cost matrix. Also, if a cost matrix is used, lower boundary lowerBound cannot be calculated because it needs a metric function. </td></tr>
    <tr><td class="paramname">lowerBound</td><td>Optional input/output parameter: lower boundary of a distance between the two signatures that is a distance between mass centers. The lower boundary may not be calculated if the user-defined cost matrix is used, the total weights of point configurations are not equal, or if the signatures consist of weights only (the signature matrices have a single column). You must** initialize *lowerBound . If the calculated distance between mass centers is greater or equal to *lowerBound (it means that the signatures are far enough), the function does not calculate EMD. In any case *lowerBound is set to the calculated distance between mass centers on return. Thus, if you want to calculate both distance between mass centers and EMD, *lowerBound should be set to 0. </td></tr>
    <tr><td class="paramname">flow</td><td>Resultant \(\texttt{size1} \times \texttt{size2}\) flow matrix: \(\texttt{flow}_{i,j}\) is a flow from \(i\) -th point of signature1 to \(j\) -th point of signature2 . </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga7e54091f0c937d49bf84152a16f76d6e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e54091f0c937d49bf84152a16f76d6e">◆ </a></span>equalizeHist()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::equalizeHist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.equalizeHist(</td><td class="paramname">src[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Equalizes the histogram of a grayscale image. </p>
<p>The function equalizes the histogram of the input image using the following algorithm:</p>
<ul>
<li>Calculate the histogram \(H\) for src .</li>
<li>Normalize the histogram so that the sum of histogram bins is 255.</li>
<li>Compute the integral of the histogram: <p class="formulaDsp">
\[H'_i = \sum _{0 \le j &lt; i} H(j)\]
</p>
</li>
<li>Transform the image using \(H'\) as a look-up table: \(\texttt{dst}(x,y) = H'(\texttt{src}(x,y))\)</li>
</ul>
<p>The algorithm normalizes the brightness and increases the contrast of the image.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source 8-bit single channel image. </td></tr>
    <tr><td class="paramname">dst</td><td>Destination image of the same size and type as src . </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d4/d26/samples_2cpp_2facedetect_8cpp-example.html#a27">samples/cpp/facedetect.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga31fdda0864e64ca6b9de252a2611758b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga31fdda0864e64ca6b9de252a2611758b">◆ </a></span>wrapperEMD()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float cv::wrapperEMD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>signature1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>signature2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>distType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>cost</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; float &gt; </td>
          <td class="paramname"><em>lowerBound</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; float &gt;()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>flow</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, lowerBound, flow</td><td>=</td><td>cv.EMD(</td><td class="paramname">signature1, signature2, distType[, cost[, lowerBound[, flow]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:40 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
